home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1992-09-28 | 5.3 KB | 156 lines |
- '***************************
- '* AMOS Professional *
- '* *
- '* AMAL_5 * Amal Play Routines
- '* * + STOS compatability
- '* (c) Europress Software *
- '* *
- '* Ronnie Simpson *
- '***************************
- '
- '-------------------------------------------
- 'Play
- '-------------------------------------------
- 'Keyword PL
- '
- 'The Amal Play instruction controls a movement pattern previously defined by
- 'the Amal accessory program which simply records a sequence made by moving
- 'the mouse and stores the information into a bank.
- 'Objects are assigned to the paths from within your Amal program with the
- 'PLay (PL) instruction followed by the path number.
- '
- 'eg. PLay 1
- '
- 'The internal register R0 now contains the tempo setting, and changing this
- 'will either slow down or speed up the movement. (measured in 1/50ths. of a
- 'second)
- 'The internal register R1 can be used to control the direction of movement:-
- '
- ' If R1>0 then movement will follow the path as defined
- ' If R1=0 then movement will follow the path in reverse
- ' If R1=-1 then movement will be aborted
- '
- '-------------------------------------------
- 'Amplay
- '-------------------------------------------
- 'Control Amal play from basic
- '
- 'The Amal PLay instruction is controlled by the internal registers R0 & R1
- 'of each individual channel and these can be changed with the Amreg= command.
- 'The purpose of the Amplay instruction is to allow the settings to be altered
- 'over a range of channels in one fell swoop.
- '
- ' +---> Tempo
- ' | +---> Direction
- ' | | +---> Range of channels
- ' Amplay 2,1,3 To 6
- '
- 'See the above Amal PLay instruction for tempo and direction settings.
- 'If the range of channels are ommited then all channels will be affected.
- 'Any of the parameters may be ommited as required:-
- '
- ' Amplay ,-1 (abort movement on all channels)
- ' Amplay 2, (change tempo of all channels)
- '
- '-------------------------------------------
- 'STOS compatible commands
- '-------------------------------------------
- 'Although Amal is far superior to the original STOS animation control the
- 'following list is a quick reference to STOS commands retained for
- 'compatibility.
- '
- ' Move X N,A$ N=channel number 0-15
- ' A$=instruction sequence
- ' Move Y N,A$ N=channel number 0-15
- ' A$=instruction sequence
- ' Move On N N=optional channel number
- ' Move Off N N=optional channel number
- ' Move Freeze N N=optional channel number
- ' = Moveon (N) N=object number
- ' Anim N,A$ N=channel number 0-15
- ' A$=instruction sequence
- ' Anim On N N=optional sequence number
- ' Anim Off N N=optional sequence number
- ' Anim Freeze N N=optional sequence number
- ' Freeze / Unfreeze No parameters and works the same as Amal Freeze
- '
- '-------------------------------------------
- 'EXAMPLE
- '-------------------------------------------
- Rem *** tidy up screen, load sprites and load PLay sequence
- '
- Colour Back $3
- Load "AmosPro_Tutorial:Objects/PLay_Bobs.abk"
- Load "AmosPro_Tutorial:Tutorials/Amal/PLay_Data.abk"
- Screen Open 0,320,200,16,Lowres : Flash Off
- Get Sprite Palette : Curs Off : Cls 0 : Hide
- Make Mask
- For N=1 To 100 : Ink Rnd(1)+2 : Plot Rnd(316)+2,Rnd(196)+2 : Next
- Ink 3 : Box 0,0 To 319,199
- Paper 0 : Pen 7 : Ink 7 : Box 3,119 To 5,191 : Locate 1,23 : Print "Power"
- Ink 5 : Draw 4,120 To 4,190
- Limit Mouse 152,100 To 440,200
- '
- Rem *** define Amal program for moving ship
- '
- A$="Anim 0,(5,5)(6,5);Loop: Let X=XM-148;If K1 Jump Up;Jump Down;"
- A$=A$+"Up: Let Y=Y-1;If Y<75 Jump A; Pause Jump Loop;A: LetY=75;PJL"
- A$=A$+"Down: Let Y=Y+1;If Y>165 Jump B; Pause Jump Loop;B: LetY=165;PJL"
- '
- Rem *** define Amal program for moving aliens with PLay instruction
- '
- B$="Anim 0,(1,3)(2,3)(3,3)(4,3);Loop: Let X=Z(220)+160;Let Y=40"
- B$=B$+"PLay 1;Pause Jump Loop"
- '
- Rem *** assign Amal channels
- '
- Bob 1,0,135,5
- Channel 0 To Bob 1
- For N=8 To 15
- Sprite N,0,0,1
- Amal N,B$
- Next
- Amal 0,A$
- '
- Rem *** start ship movement
- '
- Amal On 0
- '
- Rem *** define the variables required
- '
- HITS=0 : P=120 : LEVEL=7 : COUNT=799 : SPEED=3 : Pen 13
- '
- Rem start the main loop
- '
- Repeat
- Rem *** increase number of aliens
- Inc COUNT
- If COUNT=800 and LEVEL<15
- Inc LEVEL : Amal On LEVEL : Amplay SPEED,
- Locate 5,1 : Centre "LEVEL-"+Str$(LEVEL-7)
- COUNT=0
- End If
- Rem *** increase tempo of Play movement
- If COUNT=800 and LEVEL>14
- Inc LEVEL : Dec SPEED : Amplay SPEED,
- Locate 5,1 : Centre "LEVEL-"+Str$(LEVEL-7)
- COUNT=0
- End If
- Rem *** collision detection routine
- If Bobsprite Col(1)
- Inc HITS : Boom
- Ink 0 : Draw 4,120 To 4,120+HITS*10
- For N=1 To 5 : Colour 0,$FF0 : Wait Vbl : Colour 0,0 : Next
- End If
- Wait Vbl
- Until HITS=7
- '
- Amal Off 0 : Ink 6 : Circle X Bob(1)+11,Y Bob(1)+15,20 : Ink 8 : Circle X Bob(1)+11,Y Bob(1)+15,19
- Pen 8 : C$="G A M E O V E R"
- For N=80 To 30 Step -1 : Wait Vbl : Bell N : Next
- For N=1 To Len(C$)
- Locate 0,12 : Centre Mid$(C$,1,N)
- Wait 7
- Next
- Wait 150
- Direct